package main

import (
	"fmt"
)

func main() {
	var ch1 chan int
	ch1 = make(chan int, 20)
	fmt.Printf("%T\n", ch1)
	fmt.Println("-----------------------------------------------")
	// 将10写入管道ch1
	ch1 <- 10
	ch1 <- 11
	fmt.Println(ch1, len(ch1), cap(ch1)) //引用数据类型，值就是地址
	fmt.Println("-----------------------------------------------")
	a := <-ch1
	fmt.Println(a)
	<-ch1
	b := <-ch1
	fmt.Println(b)
	fmt.Println("-----------------------------------------------")
}
